"""
路由系统
"""
from flask_restful import Api

api = Api(prefix='/api/v1')

def init_api(app):
    api.init_app(app)

"""注册路由系统"""

from apps.main.apis import HomeApi
from apps.movies.apis import MovieListApi
from apps.cinemas.apis import CinemaListApi
from apps.cinemas.apis import CinemaDetailApi
from apps.search_movie.apis import SearchMovieListApi
from apps.user.apis import UserLoginApi,UserLogoutApi,UserRegisterApi,UserActiveApi

api.add_resource(HomeApi,'/home/',endpoint='home')
api.add_resource(MovieListApi,'/movie/',endpoint='movie')
api.add_resource(CinemaListApi,'/cinema/',endpoint='cinema')
api.add_resource(CinemaDetailApi,'/cinema/detail/',endpoint='cinema_detail')
api.add_resource(SearchMovieListApi,'/search/',endpoint='search')
api.add_resource(UserLoginApi,'/user/login/',endpoint='user_login')
api.add_resource(UserRegisterApi,'/user/register/',endpoint='user_register')
api.add_resource(UserLogoutApi,'/user/logout/',endpoint='user_logout')
api.add_resource(UserActiveApi,'/user/active/',endpoint='user_active')